package com.ruixi.spring.factorybean;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestFactory {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("conf/applicationContext.xml");
        //工厂Bean获取的是getObject()这个方法所返回的对象,而不是工厂Bean本身
        //创建对象时,默认执行无参的构造方法完成对象的创建
        Object factory = ac.getBean("factory");
        System.out.println(factory);
    }
}
